//
//  NewYearGiftsView.m
//  AffectionBee
//
//  Created by 李通 on 16/8/21.
//  Copyright © 2016年 chivalrous. All rights reserved.
//

#import "NewYearGiftsView.h"
#import "IconsAndActivitiesModel.h"

@interface NewYearGiftsView ()

@property (nonatomic,weak) UIImageView *bgImageView;

@end

@implementation NewYearGiftsView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        [self setupContentControl];
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}

- (void)setupContentControl {
    
    UIImageView *bgImageView = [[UIImageView alloc]init];
    self.bgImageView = bgImageView;
    [self.contentView addSubview:bgImageView];
    
    [self setupUI];
}

- (void)setupUI {
    
    [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.top.bottom.trailing.equalTo(self.contentView);
    }];
}

- (void)setModel:(IconsAndActivitiesModel *)model {
    
    _model = model;
    [self.bgImageView sd_setImageWithURL:[NSURL URLWithString:model.img]];
}

@end
